<?php
namespace StickyNotes\Model\Entity;

class Opportunity {

	protected $_id;
	protected $_closedate;
	protected $_description;
	protected $_name;
	protected $_probability;
	protected $_ownedsecurableitem_id;
	protected $_account_id;
	protected $_amount_currencyvalue_id;
	protected $_stage_customfield_id;
	protected $_source_customfield_id;


	public function __construct(array $options = null) {
		if (is_array($options)) {
			$this->setOptions($options);
		}
	}

	public function __set($name, $value) {
		$method = 'set' . $name;
		if (!method_exists($this, $method)) {
			throw new Exception('Invalid Method');
		}
		$this->$method($value);
	}

	public function __get($name) {
		$method = 'get' . $name;
		if (!method_exists($this, $method)) {
			throw new Exception('Invalid Method');
		}
		return $this->$method();
	}

	public function setOptions(array $options) {
		$methods = get_class_methods($this);
		foreach ($options as $key => $value) {
			$method = 'set' . ucfirst($key);
			if (in_array($method, $methods)) {
				$this->$method($value);
			}
		}
		return $this;
	}

	public function getId() {
		return $this->_id;
	}

	public function setId($id) {
		$this->_id = $id;
		return $this;
	}

	public function getClosedate() {
		return $this->_closedate;
	}

	public function setClosedate($closedate) {
		$this->_closedate = $closedate;
		return $this;
	}

	public function getDescription() {
		return $this->_description;
	}

	public function setDescription($description) {
		$this->_description = $description;
		return $this;
	}

	public function getName() {
		return $this->_name;
	}

	public function setName($name) {
		$this->_name = $name;
		return $this;
	}

	public function getProbability() {
		return $this->_probability;
	}

	public function setProbability($probability) {
		$this->_probability = $probability;
		return $this;
	}

	public function getOwned() {
		return $this->_ownedsecurableitem_id;
	}

	public function setOwned($ownedsecurableitem_id) {
		$this->_ownedsecurableitem_id = $ownedsecurableitem_id;
		return $this;
	}

	public function getAccount() {
		return $this->_account_id;
	}

	public function setAccount($account_id) {
		$this->_account_id = $account_id;
		return $this;
	}

	public function getAmount() {
		return $this->_amount_currencyvalue_id;
	}

	public function setAmount($amount_currencyvalue_id) {
		$this->_amount_currencyvalue_id = $amount_currencyvalue_id;
		return $this;
	}

	public function getStage() {
		return $this->_stage_customfield_id;
	}

	public function setStage($stage_customfield_id) {
		$this->_stage_customfield_id = $stage_customfield_id;
		return $this;
	}

	public function getSource() {
		return $this->_source_customfield_id;
	}

	public function setSource($source_customfield_id) {
		$this->_source_customfield_id = $source_customfield_id;
		return $this;
	}

}
?>